<?php
    session_start();
    require_once '../includes/runtime/lib/Propel.php';
    Propel::init("../includes/build/conf/easylib-conf.php");
    set_include_path("../includes/build/classes" . PATH_SEPARATOR . get_include_path());
    $param=$_GET['id'];
    $utilisation = TabUtilisationQuery::create()->filterByIdUtilisation($param)->findOne();
    $s1=  TabStationQuery::create()->filterByIdStation($utilisation->getFkStationDepart())->findOne();
    $s2=  TabStationQuery::create()->filterByIdStation($utilisation->getFkStationArrivee())->findOne();
    $results=array(
                'dDebut' => $utilisation->getDateDebut($format='d-m-Y H:i:s'),
                'dFin' => $utilisation->getDateFin($format='d-m-Y H:i:s'),
                'sDebut' => $s1->getStationAddress(),
                'sFin' => $s2->getStationAddress()
    );
    echo json_encode($results);
?>
